package cn.cq.admin.mapper;

import cn.cq.admin.entity.model.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author  dicraft
 * @description 针对表【course】的数据库操作Mapper
 * @createDate 2022-10-03 14:30:44
 * @Entity cn.cq.admin.entity.model.Course
 */
public interface CourseMapper extends BaseMapper<Course> {
    @Select("select c.id as id,c.course_name as courseName" +
            "  from  user_course_batch as ucb " +
            "left join batch_course as bc on ucb.batch_id = bc.batch_id" +
            " left join course as c on bc.course_id = c.id " +
            "where ucb.user_id = #{userId}")
    List<Course> listAllByUserId(Long userId);

}




